package com.seven.restaurant.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.seven.restaurant.entity.po.OrderPO;
import com.seven.restaurant.entity.request.OrderRequest;
import com.seven.restaurant.entity.vo.OrderDetailsVO;
import com.seven.restaurant.exception.ValidationException;

/**
 * <p>
 * 订单 服务类
 * </p>
 *
 * @author BaiBan
 * @since 2022-07-19
 */
public interface OrderService extends IService<OrderPO> {

    /**
     * 获取订单详细
     * @param id 订单id
     * @return {@link OrderDetailsVO}
     */
    OrderDetailsVO get(Long id);

    /**
     * 分页查询
     * @param current 页数
     * @return {@link OrderDetailsVO} 集合
     */
    IPage<OrderDetailsVO> list(Integer current);

    /**
     * 添加新订单
     * @param OrderRequest 订单请求
     * @return 订单号
     * @throws ValidationException 参数错误
     */
    Long save(OrderRequest OrderRequest) throws ValidationException;

    /**
     * 修改上菜或支付状态
     * @param id 订单主键
     * @param type 上菜或支付
     * @return 修改结果
     */
    Boolean update(Long id, String type);
}
